var download = require('download');
var fs = require('fs');

var path = require('path');

var filePath = path.join(process.cwd(), '.data');

download('http://7sbsl6.com1.z0.glb.clouddn.com/hexo/2016-09-08-17-42-07.jpg', filePath).then(() => {
  console.log('done');
});

download('http://7sbsl6.com1.z0.glb.clouddn.com/hexo/2016-09-08-17-42-07.jpg').then(data => {
  fs.writeFileSync(path.join(process.cwd(), '.data/dist/' , '1.png'), data);
});
